home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol A-4 / (Vol A-4) Vol. A4.iso / Games / selfstorage.swf / scripts / frame_5 / PlaceObject2_184_456 / CLIPACTIONRECORD on(press).as next >
Text File  |  2008-03-17  |  2KB  |  54 lines

  1. on(press){
  2.    if(_root.int_spiellaeuft == 0)
  3.    {
  4.       startTime = new Date();
  5.       _root.startzeit = startTime.getTime();
  6.       _root.int_spiellaeuft = 1;
  7.       trace("START");
  8.    }
  9.    if(_root.int_boxennummer == this.int_boxennummer)
  10.    {
  11.       if(_root.int_soundon == 1)
  12.       {
  13.          _root.mc_sounds.anhaengen.start(0,1);
  14.       }
  15.       this.int_aktiviert = 1;
  16.       dragging = 1;
  17.       int_absturz = 0;
  18.       mausx = this._xmouse;
  19.       mausy = this._ymouse;
  20.       trace("\n\nMausX: " + mausx + "\nMausY: " + mausy);
  21.       vTan = Number(mausx) / Number(mausy);
  22.       arkusTanB = Math.atan(vTan);
  23.       haltepunktwinkel = (- arkusTanB / 3.141592653589793) * 180;
  24.       if(mausy >= 0)
  25.       {
  26.          if(mausx > 0)
  27.          {
  28.             haltepunktwinkel += 180;
  29.          }
  30.          else
  31.          {
  32.             haltepunktwinkel -= 180;
  33.          }
  34.       }
  35.       trace("haltepunktwinkel: " + haltepunktwinkel);
  36.       haltepunktdistanz = Math.sqrt(mausx * mausx + mausy * mausy);
  37.       trace("numb_rotationsbeschleunigung: " + numb_rotationsbeschleunigung);
  38.       trace("v_y: " + v_y);
  39.       trace("v_x: " + v_x);
  40.       objektrotation = this._rotation;
  41.       startwinkel = 0;
  42.       abweichungswinkel = haltepunktwinkel + this._rotation;
  43.       if(abweichungswinkel > 180)
  44.       {
  45.          abweichungswinkel -= 360;
  46.       }
  47.       if(abweichungswinkel < -180)
  48.       {
  49.          abweichungswinkel += 360;
  50.       }
  51.       trace("abweichungswinkel: " + abweichungswinkel);
  52.    }
  53. }
  54.